<?php

use think\facade\Route;
use think\Route as Routes;

Route::post('/login', app\controller\api\AdminController::class . '@login');//登录
Route::any('/userinfo', app\controller\api\AdminController::class . '@userinfo')->middleware(\app\middleware\Auth::class);//登录

Route::group('backstage', function (Routes $route) {
    Route::group('config', function (Routes $route) {
        $route->any('/', app\controller\api\ConfigController::class . '@getConfig');
        $route->any('updateConfig', app\controller\api\ConfigController::class . '@updateConfig');
    })->middleware(\app\middleware\Auth::class);

    Route::group('history', function (Routes $route) {
        $route->any('getList', app\controller\api\HistoryController::class . '@getList');
        $route->any('getDetail', app\controller\api\HistoryController::class . '@getDetail');
        $route->any('addSearch', app\controller\api\HistoryController::class . '@addSearch');
        $route->any('doDelete', app\controller\api\HistoryController::class . '@doDelete');
        $route->any('getLastHistoryDetail', app\controller\api\HistoryController::class . '@getLastHistoryDetail');
    })->middleware(\app\middleware\Auth::class);
});
